
import urllib.request
def  download1(addr,mytype):
    url="http://sou.zhaopin.com/jobs/searchresult.ashx?"
    headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3969.0 Safari/537.36"}


    word = {"jl":addr,"sf":mytype,"st":0}
    word = urllib.parse.urlencode(word) # 编码成字符串
    newurl =url+word
    print(newurl)
    request=urllib.request.Request(newurl,headers=headers)#发起请求，
    # 也可以通过调⽤Request.add_header() 添加/修改⼀个特定的 header
    request.add_header("Connection", "keep-alive") #一直活着
    res=urllib.request.urlopen(request).read()
    # print(res.getcode())  # 可以查看响应状态码
    return res



addr="648" #urlopen只能处理http.不可以处理https
mytype="0"
print(download1(addr,mytype))